package org.lightdi.container.alias;

import org.lightdi.container.DIContainer;
import org.lightdi.container.factory.LightDIContainerFactory;

public class LightDI {

	public static DIContainer getDefaultContainer() {
		return LightDIContainerFactory.getDefaultContainer();
	}

	public static DIContainer getContainer(String name) {
		return LightDIContainerFactory.getContainer(name);
	}

	@SuppressWarnings("unchecked")
	public static <T> T inject(String containerName, String componentName) {
		return (T) LightDIContainerFactory.getContainer(containerName)
				.getComponent(componentName);
	}

	@SuppressWarnings("unchecked")
	public static <T> T inject(String componentName) {
		return (T) LightDIContainerFactory.getDefaultContainer().getComponent(
				componentName);
	}

}
